Skip to main content

Custom theme settings

1. Global Settings

Creating Custom Themes

1. Customize your theme variables:

The CSS variables system enables complete design control through customizable tokens. Color tokens (--ds-primary, --ds-warning) define the core palette for all UI components. Font and spacing tokens establish typography rhythm and layout consistency. Style tokens like --border-radius and --shadow-medium standardize visual treatments across elements.

:root {
/* Color Tokens */
--ds-primary: #3498db;
--ds-text-color: #333333;
--ds-background: #ffffff;
--ds-accent: #9b59b6;
--ds-warning: #e67e22;
--ds-error: #e74c3c;
--ds-success: #2ecc71;

/* Font Tokens */
--font-family: "Segoe UI", sans-serif;
--font-size-reset: 16px;

/* Spacing Tokens */
--size-base: 8px;
--size-step: 4px;
--spacing-reset: 0;

/* Size Units */
--size-unit: px;

/* Style Tokens */
--border-radius: 6px;
--shadow-light: 0 1px 3px rgba(0, 0, 0, 0.1);
--shadow-medium: 0 4px 6px rgba(0, 0, 0, 0.1);

/* Development Aids */
--wireframe-border: 1px dashed #ccc;
}

.button {
background-color: var(--ds-primary);
color: white;
padding: var(--size-base);
border-radius: var(--border-radius);
font-family: var(--font-family);
}

2. Preview Theme Tokens (Map)

Visual swatches display all active color tokens for quick reference. The interactive map shows how tokens propagate through components. Hover tooltips reveal token names and current values. Live updates reflect changes made in the variable editor.

--ds-primary

--ds-warning

--ds-error

--ds-success

Updated project configuration

3. Theme Token Reference

The token reference provides a complete inventory of all customizable design variables, systematically organized by functional category (colors, typography, spacing, etc.). Each token entry displays the default value, intended usage context, and sample implementation code for immediate application. The table format enables quick scanning and comparison between related tokens, with syntax-highlighted examples ready for direct copying. This centralized reference ensures design consistency while documenting all available customization points.

🎨 Color Tokens

Define the core visual identity through a systematic color palette.the colors establish brand consistency across components.Semantic colors standardize feedback states. All values support HEX, RGB, and HSL formats for design flexibility.

TokenUsageValue
--ds-primaryMain brand color#3498db
--ds-warningWarning elements#e67e22
--ds-errorError states#e74c3c
--ds-successSuccess confirmations#2ecc71

🔤 Font Tokens

Control typography hierarchy with font family and size variables. Size tokens (--font-size-reset) maintain proportional scaling. Line-height and weight variables ensure readable text presentation across devices.

TokenDescriptionValue
--font-familyBase font family'Segoe UI'
--font-size-resetDefault text size16px

📐 Spacing & Size Tokens

Establish consistent layout rhythm through spacing variables. Base unit (--size-base: 8px) enables modular design scaling. The unit system (--size-unit) supports px/rem/em for responsive designs.

TokenDescriptionValue
--size-baseBase spacing unit8px
--size-stepStep size for increments4px
--spacing-resetSpacing reset value0
--size-unitUnit used for spacing/sizingpx

🧩 Style Tokens

Standardize visual treatments with predefined style variables. Border radius (--border-radius) softens component edges uniformly. Transition durations and easing curves ensure consistent motion design.

TokenDescriptionValue
--border-radiusStandard border radius6px
--shadow-lightLight shadow layer0 1px 3px rgba(0,0,0,0.1)
--shadow-mediumMedium depth shadow0 4px 6px rgba(0,0,0,0.1)

📉 Wireframe Tokens

Facilitate UI prototyping with development-focused variables. --wireframe-border highlights layout structures during design phases. Debug colors distinguish component boundaries in test modes. These tokens automatically disable in production builds.

TokenDescriptionValue
--wireframe-borderBorder for wireframe mode1px dashed #ccc

4.Preview Themes

Live preview pane shows multiple component states simultaneously. Toggle between light/dark modes to test appearance. Visual regression checks highlight unintended changes. Responsive controls verify mobile/desktop rendering.

Preview Theme configuration

5. Save Your Theme

Versioned saving preserves iteration history with timestamps. Name themes descriptively (e.g. "Dark-Mode-v2"). Shareable export generates portable theme packages. Organization-wide themes can be enforced by admins

Once your tokens are customized, save your theme with a unique name to reuse across projects.

Example Chart Visualizations

Here are some example visualizations created using Digisquares:


Component Customization Reference

Component Categories

Systematic organization of all customizable UI elements. General components (buttons, icons) inherit from base tokens. Specialized components (data tables, forms) have extended properties. Category-specific overrides available where needed.

CategoryComponents
GeneralButton, Icon, Typography
LayoutDivider, Grid, Layout, Space
NavigationMenu, Pagination, Steps, Breadcrumb, Dropdown
Data EntryForm, Input, Select, DatePicker, Checkbox, Radio, Switch, Upload
Data DisplayTable, Card, Tabs, Tag, Avatar, Badge, Popover, Tooltip
FeedbackModal, Notification, Message, Alert, Progress, Result, Spin

Customization Guide

Step 1: Access Theme Builder

  1. Click the "Open Theme Builder Launch through project dashboard" button below:

    Open Theme Builder

  2. Authenticate if required

  3. Select your project context

Step 2: Modify Values

// Example theme configuration object
{
"colors": {
"primary": "#1890ff",
"secondary": "#13c2c2",
"success": "#52c41a",
"warning": "#faad14",
"error": "#ff4d4f"
},
"typography": {
"fontFamily": "'Inter', sans-serif",
"fontSizes": {
"base": "14px",
"large": "16px",
"small": "12px"
}
},
"spacing": {
"base": "8px",
"large": "16px"
}
}

Component Inheritance Flow

Visual hierarchy showing token propagation flow. Base tokens cascade to all components. Component-specific overrides take precedence. Fallback values ensure consistent rendering.

Step 3: Preview & Save

  1. Live Preview Panel

    • See changes in real-time as you modify values
    • Toggle between light/dark modes to test appearance
  2. Component Testing

    • Verify styles across different component types:
      Buttons → Forms → Data Displays → Overlays
    • Check responsive behavior at different breakpoints
  3. Version Saving

    • Use descriptive comments:
      "Dark theme v1.2 - Updated primary palette (#1890ff → #1a73e8)"
    • Include date and author initials when team collaborating

Best Practices

✅ Version Control

- Save directly over existing themes
+ Create new versions before major changes (v1.0 → v2.0)

📝 Documentation

  1. Record all custom values in /docs/theme-guide.md
  2. Note special cases (e.g., "Table headers use @primary-color-dark")
  3. Include screenshot references

👁️ Accessibility

/* Minimum contrast standards */
body {
color: #333; /* Text */
background: #fff; /* BG */
/* Contrast ratio: 12.63:1 ✅ */
}

📏 Consistency

// Recommended spacing scale
const spacing = {
base: 8, // All multiples of 8
sm: 8,
md: 16,
lg: 24,
xl: 32,
};

💾 Backups

Export command example

digisquares-cli theme export --file=backup-2023-11-15.json